﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Xml.Serialization;
using TmU220PrintHelperV2d0.Service;

namespace TmU220PrintHelperV2d0.Entity
{
    /// <summary>
    /// ThinkPhp的接口集
    /// </summary>
    [XmlRoot("ThinkPhp接口组集")]
    public class ThinkPhpApiGroupSetV1d0
    {
        /// <summary>
        /// 项目名称
        /// </summary>
        [XmlArray("接口组列表"), XmlArrayItem("接口组")]
        public List<ThinkPhpApiGroupV1d0> ApiGroupList { get; set; }
        public ThinkPhpApiGroupSetV1d0()
        {
            ApiGroupList = new List<ThinkPhpApiGroupV1d0>();
        }
    }
    /// <summary>
    /// ThinkPhp的接口组
    /// </summary>
    public class ThinkPhpApiGroupV1d0
    {
        [XmlElement("接口类名称")]
        public string group_name { get; set; }
        [XmlElement("主地址")]
        public string main_url { get; set; }
        [XmlElement("接口类版本")]
        public string api_version { get; set; }
        [XmlArray("接口列表"), XmlArrayItem("接口")]
        public List<ThinkPhpApiV1d0> ApiList { get; set; }
        public ThinkPhpApiGroupV1d0()
        {
            group_name = "";
            main_url = "";
            api_version = "";
            ApiList = new List<ThinkPhpApiV1d0>();
        }
        public ThinkPhpApiGroupV1d0(string name,string url,string version,List<ThinkPhpApiV1d0> list)
        {
            group_name = name;
            main_url = url;
            api_version = version;
            ApiList = list;
        }
    }
    public class ThinkPhpApiV1d0
    {
        /// <summary>
        /// 接口名称
        /// </summary>
        [XmlElement("名称")]
        public string name { get; set; }
        /// <summary>
        /// 接口描述
        /// </summary>
        [XmlElement("描述")]
        public string describe { get; set; }
        [XmlIgnore]
        public string main_url { get; set; }
        /// <summary>
        /// 接口方法
        /// </summary>
        [XmlElement("方法名称")]
        public  string method_name { get; set; }
        /// <summary>
        /// 接口类型
        /// </summary>
        [XmlElement("类型")]
        public  string type { get; set; }
        /// <summary>
        /// 接口消息体模板
        /// </summary>
        [XmlElement("接口参数模板")]
        public string parameter_templete { get; set; }
        public ThinkPhpApiV1d0()
        {
            name = "接口";
            describe ="";
            method_name = "";
            type = "POST";
            parameter_templete = "";
        }
        public ThinkPhpApiV1d0(string name_,string describe_,string main_url_,string method_name_,string type_,string parameter_templete_)
        {
            name = name_;
            describe = describe_;
            main_url = main_url_;
            method_name = method_name_;
            type = type_;
            parameter_templete = parameter_templete_;
        }
    }
}
